{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "from keras.layers import Input, Dense,Dropout\n",
    "#from keras.layers.core import AutoEncoder\n",
    "from keras.models import Model,Sequential\n",
    "#from keras.layers import containers\n",
    "import numpy as np\n",
    "import pandas\n",
    "import os\n",
    "from keras.utils import np_utils\n",
    "from keras.callbacks import EarlyStopping\n",
    "from keras.optimizers import SGD\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def process_data(M,N,S_day,L_day,fac_num):\n",
    "    #区分训练集和测试集,以最后一个换仓日为界\n",
    "    Ctrain=M[M.Date>S_day]\n",
    "    C_train=Ctrain[Ctrain.Date<L_day]\n",
    "    C_test=N[N.Date==L_day]\n",
    "    name=['Date','Symbol','Return']\n",
    "    Retu=C_test[name]\n",
    "\n",
    "    #fac_num=C_data.shape[1]-2\n",
    "    TrainX=np.array(C_train.iloc[:,2:fac_num+2].values.astype('float32'))\n",
    "    TestX=np.array(C_test.iloc[:,2:fac_num+2].values.astype('float32')) \n",
    "    TrainY=C_train['label'].astype('category')\n",
    "    TrainY=np.array(TrainY.tolist())\n",
    "    #TestY=C_test['label'].astype('category')\n",
    "    #TestY=np.array(TestY.tolist())\n",
    "    rval=[Retu,(TrainX,TrainY),TestX]\n",
    "    return  rval\n",
    "\n",
    "\n",
    "def load_retu(file,C_data,L_day):\n",
    "    Ret=pandas.read_csv(file,engine='python', skipfooter=3)\n",
    "    # Y分为两档，换仓期间收益率表现为前20%的为强势股标为1，后20%为弱势标为0\n",
    "    Y_data=Ret.rename(columns={'tdate': 'Date','symbol':'Symbol'})\n",
    "    #print(len(C_data))\n",
    "    #print(Y_data.head())\n",
    "    M=pandas.merge(C_data,Y_data,how='inner',on=['Date','Symbol'])\n",
    "    #print(M.head())\n",
    "    #print(len(M))\n",
    "    \n",
    "    #区分训练集和测试集,以最后一个换仓日为界\n",
    "    lastday=split_date(L_day)\n",
    "    C_train=M[M.Date<int(lastday)]\n",
    "    C_test=M[M.Date==int(lastday)]\n",
    "    #print(C_test)\n",
    "    fac_num=C_data.shape[1]-2\n",
    "    TrainX=np.array(C_train.iloc[:,2:fac_num+2].values.astype('float32'))\n",
    "    TestX=np.array(C_test.iloc[:,2:fac_num+2].values.astype('float32')) \n",
    "    TrainY=C_train['label'].astype('category')\n",
    "    TrainY=np.array(TrainY.tolist())\n",
    "    TestY=C_test['label'].astype('category')\n",
    "    TestY=np.array(TestY.tolist())\n",
    "    rval=[(TrainX,TrainY),(TestX,TestY)]\n",
    "    return rval\n",
    "\n",
    "def neural_network(dim,nb_cl,loss='categorical_crossentropy', optimizer='adadelta'):\n",
    "    ######神经网络结构搭建\n",
    "    encoding_dim = dim[-1]\n",
    "    model=Sequential()\n",
    "    model.add(Dense(input_dim=dim[0],output_dim=dim[1],activation='relu'))\n",
    "    model.add(Dropout(.25))\n",
    "    model.add(Dense(input_dim=dim[1],output_dim=dim[2],activation='relu'))\n",
    "    model.add(Dropout(.25))\n",
    "    model.add(Dense(input_dim=dim[2],output_dim=dim[3],activation='relu'))\n",
    "    model.add(Dropout(.25))\n",
    "    model.add(Dense(input_dim=dim[3],output_dim=nb_cl,activation='softmax'))#只看换仓日当天压缩后的factor\n",
    "    #print(classifier.layers)\n",
    "    #lr=.05\n",
    "    #decay=1e-6\n",
    "    #momentum=.9\n",
    "    #model.add(Dense(input_dim=encoding_dim,output_dim=8,init='normal',activation='tanh'))\n",
    "    #sgd = SGD(lr, decay, momentum, nesterov=True)\n",
    "    model.compile(loss='categorical_crossentropy', optimizer='adadelta',metrics=['accuracy'])\n",
    "    return model\n",
    "\n",
    "def backtest(Retu):\n",
    "    name1=['Date','Symbol','Return','proba1']\n",
    "    Ret1=Retu[name1]\n",
    "    name2=['Date','Symbol','Return','proba0']\n",
    "    Ret2=Retu[name2]\n",
    "\n",
    "    long=Ret1.sort(columns=['proba1'],ascending=False)[0:100]\n",
    "    short=Ret2.sort(columns=['proba0'],ascending=False)[0:100]\n",
    "    \n",
    "    long50=Ret1.sort(columns=['proba1'],ascending=False)[0:50]\n",
    "    short50=Ret2.sort(columns=['proba0'],ascending=False)[0:50]\n",
    "    alpha=np.mean(long['Return'])-np.mean(short['Return'])\n",
    "    print(\"\\n alpha of long/short first 100 is  %.2f%%\" % (alpha*100))\n",
    "    print(\"\\n long return is %.2f%%\" % (np.mean(long['Return'])*100))\n",
    "    print(\"\\n short return is %.2f%%\" % (np.mean(short['Return'])*100))\n",
    "    \n",
    "    long100=np.mean(long['Return'])\n",
    "    short100=np.mean(short['Return'])\n",
    "    #print(long50)\n",
    "    #print(short50)\n",
    "    #alpha_sh=np.mean(long['Return'])-(-0.0487)\n",
    "    #print(\"\\n alpha to sh300 is  %.2f%%\" % (alpha_sh*100))\n",
    "\n",
    "    alpha50=np.mean(long50['Return'])-np.mean(short50['Return'])\n",
    "    print(\"\\n alpha of long/short first 50 is  %.2f%%\" % (alpha50*100))\n",
    "    print(\"\\n long return is %.2f%%\" % (np.mean(long50['Return'])*100))\n",
    "    print(\"\\n short return is %.2f%%\" % (np.mean(short50['Return'])*100))\n",
    "\n",
    "    return alpha,alpha50,long100,short100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "起始时间：20110908\n",
      "换仓日： 20140930\n",
      "(2381, 21)\n",
      "Train on 40387 samples, validate on 10097 samples\n",
      "Epoch 1/100\n",
      "40387/40387 [==============================] - 3s - loss: 0.6989 - acc: 0.5217 - val_loss: 0.6829 - val_acc: 0.5712\n",
      "Epoch 2/100\n",
      "40387/40387 [==============================] - 0s - loss: 0.6933 - acc: 0.5309 - val_loss: 0.6809 - val_acc: 0.5783\n",
      "Epoch 3/100\n",
      "40387/40387 [==============================] - 0s - loss: 0.6894 - acc: 0.5408 - val_loss: 0.6796 - val_acc: 0.5808\n",
      "Epoch 4/100\n",
      "40387/40387 [==============================] - 0s - loss: 0.6887 - acc: 0.5425 - val_loss: 0.6811 - val_acc: 0.5780\n",
      "Epoch 5/100\n",
      "40387/40387 [==============================] - 0s - loss: 0.6864 - acc: 0.5445 - val_loss: 0.6805 - val_acc: 0.5732\n",
      "Epoch 6/100\n",
      "40387/40387 [==============================] - 0s - loss: 0.6867 - acc: 0.5447 - val_loss: 0.6804 - val_acc: 0.5816\n",
      "2240/2381 [===========================>..] - ETA: 0s\n",
      " test IC: 0.0518866561345\n",
      "\n",
      " alpha of long/short first 100 is  3.26%\n",
      "\n",
      " long return is 5.26%\n",
      "\n",
      " short return is 2.01%\n",
      "\n",
      " alpha of long/short first 50 is  1.74%\n",
      "\n",
      " long return is 3.49%\n",
      "\n",
      " short return is 1.75%\n",
      "起始时间：20111014\n",
      "换仓日： 20141104\n",
      "(2393, 21)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:71: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n",
      "/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:72: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n",
      "/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:74: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n",
      "/opt/conda/lib/python3.5/site-packages/ipykernel/__main__.py:75: FutureWarning: sort(columns=....) is deprecated, use sort_values(by=.....)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 40528 samples, validate on 10132 samples\n",
      "Epoch 1/100\n",
      "40528/40528 [==============================] - 3s - loss: 0.6992 - acc: 0.5177 - val_loss: 0.6841 - val_acc: 0.5721\n",
      "Epoch 2/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6923 - acc: 0.5305 - val_loss: 0.6815 - val_acc: 0.5698\n",
      "Epoch 3/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6895 - acc: 0.5381 - val_loss: 0.6806 - val_acc: 0.5692\n",
      "Epoch 4/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6870 - acc: 0.5428 - val_loss: 0.6789 - val_acc: 0.5710\n",
      "Epoch 5/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6867 - acc: 0.5470 - val_loss: 0.6801 - val_acc: 0.5719\n",
      "Epoch 6/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6859 - acc: 0.5466 - val_loss: 0.6790 - val_acc: 0.5722\n",
      "Epoch 7/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6848 - acc: 0.5497 - val_loss: 0.6783 - val_acc: 0.5749\n",
      "Epoch 8/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6835 - acc: 0.5530 - val_loss: 0.6784 - val_acc: 0.5767\n",
      "Epoch 9/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6843 - acc: 0.5524 - val_loss: 0.6785 - val_acc: 0.5764\n",
      "Epoch 10/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6827 - acc: 0.5545 - val_loss: 0.6776 - val_acc: 0.5764\n",
      "Epoch 11/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6833 - acc: 0.5569 - val_loss: 0.6785 - val_acc: 0.5767\n",
      "Epoch 12/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6825 - acc: 0.5580 - val_loss: 0.6781 - val_acc: 0.5752\n",
      "Epoch 13/100\n",
      "40528/40528 [==============================] - 0s - loss: 0.6823 - acc: 0.5620 - val_loss: 0.6781 - val_acc: 0.5765\n",
      "2272/2393 [===========================>..] - ETA: 0s\n",
      " test IC: -0.0421904195829\n",
      "\n",
      " alpha of long/short first 100 is  -1.95%\n",
      "\n",
      " long return is 4.30%\n",
      "\n",
      " short return is 6.25%\n",
      "\n",
      " alpha of long/short first 50 is  0.26%\n",
      "\n",
      " long return is 4.15%\n",
      "\n",
      " short return is 3.89%\n",
      "起始时间：20111111\n",
      "换仓日： 20141202\n",
      "(2397, 21)\n",
      "Train on 40656 samples, validate on 10165 samples\n",
      "Epoch 1/100\n",
      "40656/40656 [==============================] - 3s - loss: 0.6965 - acc: 0.5186 - val_loss: 0.6825 - val_acc: 0.5663\n",
      "Epoch 2/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6903 - acc: 0.5363 - val_loss: 0.6823 - val_acc: 0.5645\n",
      "Epoch 3/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6872 - acc: 0.5412 - val_loss: 0.6817 - val_acc: 0.5642\n",
      "Epoch 4/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6858 - acc: 0.5468 - val_loss: 0.6803 - val_acc: 0.5612\n",
      "Epoch 5/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6849 - acc: 0.5496 - val_loss: 0.6816 - val_acc: 0.5670\n",
      "Epoch 6/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6840 - acc: 0.5536 - val_loss: 0.6808 - val_acc: 0.5667\n",
      "Epoch 7/100\n",
      "40656/40656 [==============================] - 0s - loss: 0.6842 - acc: 0.5512 - val_loss: 0.6806 - val_acc: 0.5633\n",
      "2240/2397 [===========================>..] - ETA: 0s\n",
      " test IC: -0.2536501514\n",
      "\n",
      " alpha of long/short first 100 is  -17.96%\n",
      "\n",
      " long return is -8.47%\n",
      "\n",
      " short return is 9.49%\n",
      "\n",
      " alpha of long/short first 50 is  -20.81%\n",
      "\n",
      " long return is -7.78%\n",
      "\n",
      " short return is 13.02%\n",
      "起始时间：20111209\n",
      "换仓日： 20141230\n",
      "(2390, 21)\n",
      "Train on 40835 samples, validate on 10209 samples\n",
      "Epoch 1/100\n",
      "40835/40835 [==============================] - 3s - loss: 0.6950 - acc: 0.5242 - val_loss: 0.6887 - val_acc: 0.5447\n",
      "Epoch 2/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6903 - acc: 0.5352 - val_loss: 0.6889 - val_acc: 0.5436\n",
      "Epoch 3/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6884 - acc: 0.5426 - val_loss: 0.6891 - val_acc: 0.5428\n",
      "Epoch 4/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6874 - acc: 0.5439 - val_loss: 0.6886 - val_acc: 0.5419\n",
      "Epoch 5/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6864 - acc: 0.5481 - val_loss: 0.6887 - val_acc: 0.5388\n",
      "Epoch 6/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6847 - acc: 0.5545 - val_loss: 0.6885 - val_acc: 0.5412\n",
      "Epoch 7/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6836 - acc: 0.5488 - val_loss: 0.6881 - val_acc: 0.5397\n",
      "Epoch 8/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6834 - acc: 0.5544 - val_loss: 0.6888 - val_acc: 0.5401\n",
      "Epoch 9/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6828 - acc: 0.5543 - val_loss: 0.6880 - val_acc: 0.5449\n",
      "Epoch 10/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6825 - acc: 0.5576 - val_loss: 0.6881 - val_acc: 0.5447\n",
      "Epoch 11/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6814 - acc: 0.5617 - val_loss: 0.6883 - val_acc: 0.5445\n",
      "Epoch 12/100\n",
      "40835/40835 [==============================] - 0s - loss: 0.6819 - acc: 0.5596 - val_loss: 0.6885 - val_acc: 0.5435\n",
      "2272/2390 [===========================>..] - ETA: 0s\n",
      " test IC: 0.276347982544\n",
      "\n",
      " alpha of long/short first 100 is  14.15%\n",
      "\n",
      " long return is 12.77%\n",
      "\n",
      " short return is -1.38%\n",
      "\n",
      " alpha of long/short first 50 is  14.93%\n",
      "\n",
      " long return is 13.29%\n",
      "\n",
      " short return is -1.64%\n",
      "起始时间：20120110\n",
      "换仓日： 20150129\n",
      "(2418, 21)\n",
      "Train on 40920 samples, validate on 10230 samples\n",
      "Epoch 1/100\n",
      "40920/40920 [==============================] - 3s - loss: 0.6972 - acc: 0.5210 - val_loss: 0.6902 - val_acc: 0.5452\n",
      "Epoch 2/100\n",
      "40920/40920 [==============================] - 0s - loss: 0.6894 - acc: 0.5411 - val_loss: 0.6897 - val_acc: 0.5415\n",
      "Epoch 3/100\n",
      "40920/40920 [==============================] - 0s - loss: 0.6874 - acc: 0.5447 - val_loss: 0.6879 - val_acc: 0.5458\n",
      "Epoch 4/100\n",
      "40920/40920 [==============================] - 0s - loss: 0.6856 - acc: 0.5509 - val_loss: 0.6880 - val_acc: 0.5451\n",
      "Epoch 5/100\n",
      "40920/40920 [==============================] - 0s - loss: 0.6846 - acc: 0.5515 - val_loss: 0.6880 - val_acc: 0.5446\n",
      "Epoch 6/100\n",
      "40920/40920 [==============================] - 0s - loss: 0.6841 - acc: 0.5521 - val_loss: 0.6880 - val_acc: 0.5408\n",
      "2418/2418 [==============================] - 2s     \n",
      "2112/2418 [=========================>....] - ETA: 0s\n",
      " test IC: 0.0930426051321\n",
      "\n",
      " alpha of long/short first 100 is  2.45%\n",
      "\n",
      " long return is 10.23%\n",
      "\n",
      " short return is 7.77%\n",
      "\n",
      " alpha of long/short first 50 is  0.89%\n",
      "\n",
      " long return is 10.10%\n",
      "\n",
      " short return is 9.21%\n",
      "起始时间：20120214\n",
      "换仓日： 20150305\n",
      "(2417, 21)\n",
      "Train on 41366 samples, validate on 10342 samples\n",
      "Epoch 1/100\n",
      "41366/41366 [==============================] - 3s - loss: 0.6998 - acc: 0.5112 - val_loss: 0.6873 - val_acc: 0.5512\n",
      "Epoch 2/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6907 - acc: 0.5366 - val_loss: 0.6858 - val_acc: 0.5539\n",
      "Epoch 3/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6877 - acc: 0.5412 - val_loss: 0.6851 - val_acc: 0.5525\n",
      "Epoch 4/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6862 - acc: 0.5472 - val_loss: 0.6845 - val_acc: 0.5544\n",
      "Epoch 5/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6855 - acc: 0.5500 - val_loss: 0.6851 - val_acc: 0.5522\n",
      "Epoch 6/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6836 - acc: 0.5538 - val_loss: 0.6847 - val_acc: 0.5521\n",
      "Epoch 7/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6825 - acc: 0.5576 - val_loss: 0.6845 - val_acc: 0.5563\n",
      "Epoch 8/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6818 - acc: 0.5604 - val_loss: 0.6839 - val_acc: 0.5577\n",
      "Epoch 9/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6819 - acc: 0.5611 - val_loss: 0.6840 - val_acc: 0.5556\n",
      "Epoch 10/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6808 - acc: 0.5597 - val_loss: 0.6837 - val_acc: 0.5593\n",
      "Epoch 11/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6804 - acc: 0.5603 - val_loss: 0.6830 - val_acc: 0.5623\n",
      "Epoch 12/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6807 - acc: 0.5620 - val_loss: 0.6837 - val_acc: 0.5589\n",
      "Epoch 13/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6804 - acc: 0.5598 - val_loss: 0.6838 - val_acc: 0.5560\n",
      "Epoch 14/100\n",
      "41366/41366 [==============================] - 0s - loss: 0.6802 - acc: 0.5603 - val_loss: 0.6839 - val_acc: 0.5555\n",
      "2240/2417 [==========================>...] - ETA: 0s\n",
      " test IC: 0.040593063501\n",
      "\n",
      " alpha of long/short first 100 is  0.99%\n",
      "\n",
      " long return is 23.47%\n",
      "\n",
      " short return is 22.48%\n",
      "\n",
      " alpha of long/short first 50 is  1.74%\n",
      "\n",
      " long return is 22.00%\n",
      "\n",
      " short return is 20.26%\n",
      "起始时间：20120313\n",
      "换仓日： 20150402\n",
      "(2414, 21)\n",
      "Train on 41784 samples, validate on 10446 samples\n",
      "Epoch 1/100\n",
      "41784/41784 [==============================] - 3s - loss: 0.6936 - acc: 0.5245 - val_loss: 0.6895 - val_acc: 0.5395\n",
      "Epoch 2/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6885 - acc: 0.5417 - val_loss: 0.6881 - val_acc: 0.5438\n",
      "Epoch 3/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6850 - acc: 0.5491 - val_loss: 0.6877 - val_acc: 0.5468\n",
      "Epoch 4/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6851 - acc: 0.5504 - val_loss: 0.6870 - val_acc: 0.5490\n",
      "Epoch 5/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6833 - acc: 0.5539 - val_loss: 0.6870 - val_acc: 0.5495\n",
      "Epoch 6/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6836 - acc: 0.5530 - val_loss: 0.6870 - val_acc: 0.5471\n",
      "Epoch 7/100\n",
      "41784/41784 [==============================] - 0s - loss: 0.6822 - acc: 0.5549 - val_loss: 0.6870 - val_acc: 0.5501\n",
      "2240/2414 [==========================>...] - ETA: 0s\n",
      " test IC: 0.0797094910939\n",
      "\n",
      " alpha of long/short first 100 is  10.42%\n",
      "\n",
      " long return is 17.47%\n",
      "\n",
      " short return is 7.05%\n",
      "\n",
      " alpha of long/short first 50 is  14.31%\n",
      "\n",
      " long return is 17.74%\n",
      "\n",
      " short return is 3.44%\n",
      "起始时间：20120413\n",
      "换仓日： 20150504\n",
      "(2418, 21)\n",
      "Train on 42190 samples, validate on 10548 samples\n",
      "Epoch 1/100\n",
      "42190/42190 [==============================] - 3s - loss: 0.6944 - acc: 0.5272 - val_loss: 0.6950 - val_acc: 0.5197\n",
      "Epoch 2/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6876 - acc: 0.5470 - val_loss: 0.6951 - val_acc: 0.5218\n",
      "Epoch 3/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6844 - acc: 0.5531 - val_loss: 0.6945 - val_acc: 0.5259\n",
      "Epoch 4/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6837 - acc: 0.5535 - val_loss: 0.6948 - val_acc: 0.5294\n",
      "Epoch 5/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6823 - acc: 0.5566 - val_loss: 0.6930 - val_acc: 0.5302\n",
      "Epoch 6/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6816 - acc: 0.5621 - val_loss: 0.6937 - val_acc: 0.5311\n",
      "Epoch 7/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6813 - acc: 0.5613 - val_loss: 0.6938 - val_acc: 0.5347\n",
      "Epoch 8/100\n",
      "42190/42190 [==============================] - 0s - loss: 0.6816 - acc: 0.5599 - val_loss: 0.6936 - val_acc: 0.5345\n",
      "2368/2418 [============================>.] - ETA: 0s\n",
      " test IC: 0.18180378848\n",
      "\n",
      " alpha of long/short first 100 is  19.46%\n",
      "\n",
      " long return is 38.32%\n",
      "\n",
      " short return is 18.86%\n",
      "\n",
      " alpha of long/short first 50 is  20.28%\n",
      "\n",
      " long return is 38.49%\n",
      "\n",
      " short return is 18.22%\n",
      "起始时间：20120515\n",
      "换仓日： 20150601\n",
      "(2458, 21)\n",
      "Train on 42217 samples, validate on 10555 samples\n",
      "Epoch 1/100\n",
      "42217/42217 [==============================] - 3s - loss: 0.6945 - acc: 0.5267 - val_loss: 0.6912 - val_acc: 0.5361\n",
      "Epoch 2/100\n",
      "42217/42217 [==============================] - 0s - loss: 0.6878 - acc: 0.5448 - val_loss: 0.6898 - val_acc: 0.5427\n",
      "Epoch 3/100\n",
      "42217/42217 [==============================] - 0s - loss: 0.6852 - acc: 0.5524 - val_loss: 0.6906 - val_acc: 0.5357\n",
      "Epoch 4/100\n",
      "42217/42217 [==============================] - 0s - loss: 0.6829 - acc: 0.5613 - val_loss: 0.6907 - val_acc: 0.5369\n",
      "Epoch 5/100\n",
      "42217/42217 [==============================] - 0s - loss: 0.6813 - acc: 0.5614 - val_loss: 0.6904 - val_acc: 0.5369\n",
      "2176/2458 [=========================>....] - ETA: 0s\n",
      " test IC: 0.242195844792\n",
      "\n",
      " alpha of long/short first 100 is  15.70%\n",
      "\n",
      " long return is -4.10%\n",
      "\n",
      " short return is -19.80%\n",
      "\n",
      " alpha of long/short first 50 is  19.86%\n",
      "\n",
      " long return is -4.05%\n",
      "\n",
      " short return is -23.90%\n",
      "起始时间：20120612\n",
      "换仓日： 20150630\n",
      "(2469, 21)\n",
      "Train on 42243 samples, validate on 10561 samples\n",
      "Epoch 1/100\n",
      "42243/42243 [==============================] - 3s - loss: 0.6960 - acc: 0.5259 - val_loss: 0.6836 - val_acc: 0.5648\n",
      "Epoch 2/100\n",
      "42243/42243 [==============================] - 0s - loss: 0.6883 - acc: 0.5435 - val_loss: 0.6832 - val_acc: 0.5629\n",
      "Epoch 3/100\n",
      "42243/42243 [==============================] - 1s - loss: 0.6853 - acc: 0.5549 - val_loss: 0.6829 - val_acc: 0.5633\n",
      "Epoch 4/100\n",
      "42243/42243 [==============================] - 0s - loss: 0.6844 - acc: 0.5574 - val_loss: 0.6828 - val_acc: 0.5651\n",
      "Epoch 5/100\n",
      "42243/42243 [==============================] - 0s - loss: 0.6817 - acc: 0.5618 - val_loss: 0.6830 - val_acc: 0.5588\n",
      "Epoch 6/100\n",
      "42243/42243 [==============================] - 1s - loss: 0.6818 - acc: 0.5622 - val_loss: 0.6825 - val_acc: 0.5601\n",
      "Epoch 7/100\n",
      "42243/42243 [==============================] - 1s - loss: 0.6811 - acc: 0.5620 - val_loss: 0.6828 - val_acc: 0.5599\n",
      "Epoch 8/100\n",
      "42243/42243 [==============================] - 0s - loss: 0.6802 - acc: 0.5615 - val_loss: 0.6827 - val_acc: 0.5594\n",
      "Epoch 9/100\n",
      "42243/42243 [==============================] - 0s - loss: 0.6799 - acc: 0.5666 - val_loss: 0.6828 - val_acc: 0.5589\n",
      "2400/2469 [============================>.] - ETA: 0s\n",
      " test IC: -0.0240897107019\n",
      "\n",
      " alpha of long/short first 100 is  3.13%\n",
      "\n",
      " long return is -16.94%\n",
      "\n",
      " short return is -20.07%\n",
      "\n",
      " alpha of long/short first 50 is  4.21%\n",
      "\n",
      " long return is -15.71%\n",
      "\n",
      " short return is -19.92%\n",
      "起始时间：20120711\n",
      "换仓日： 20150728\n",
      "(2462, 21)\n",
      "Train on 42320 samples, validate on 10580 samples\n",
      "Epoch 1/100\n",
      "42320/42320 [==============================] - 3s - loss: 0.6936 - acc: 0.5273 - val_loss: 0.6822 - val_acc: 0.5685\n",
      "Epoch 2/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6867 - acc: 0.5497 - val_loss: 0.6813 - val_acc: 0.5689\n",
      "Epoch 3/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6865 - acc: 0.5505 - val_loss: 0.6807 - val_acc: 0.5706\n",
      "Epoch 4/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6842 - acc: 0.5554 - val_loss: 0.6807 - val_acc: 0.5700\n",
      "Epoch 5/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6835 - acc: 0.5575 - val_loss: 0.6808 - val_acc: 0.5717\n",
      "Epoch 6/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6815 - acc: 0.5623 - val_loss: 0.6807 - val_acc: 0.5685\n",
      "Epoch 7/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6816 - acc: 0.5633 - val_loss: 0.6810 - val_acc: 0.5716\n",
      "Epoch 8/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6817 - acc: 0.5620 - val_loss: 0.6806 - val_acc: 0.5717\n",
      "Epoch 9/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6797 - acc: 0.5675 - val_loss: 0.6804 - val_acc: 0.5698\n",
      "Epoch 10/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6807 - acc: 0.5668 - val_loss: 0.6804 - val_acc: 0.5708\n",
      "Epoch 11/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6797 - acc: 0.5681 - val_loss: 0.6802 - val_acc: 0.5692\n",
      "Epoch 12/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6800 - acc: 0.5651 - val_loss: 0.6804 - val_acc: 0.5711\n",
      "Epoch 13/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6786 - acc: 0.5681 - val_loss: 0.6803 - val_acc: 0.5677\n",
      "Epoch 14/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6789 - acc: 0.5671 - val_loss: 0.6798 - val_acc: 0.5688\n",
      "Epoch 15/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6784 - acc: 0.5701 - val_loss: 0.6803 - val_acc: 0.5674\n",
      "Epoch 16/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6793 - acc: 0.5662 - val_loss: 0.6799 - val_acc: 0.5703\n",
      "Epoch 17/100\n",
      "42320/42320 [==============================] - 0s - loss: 0.6781 - acc: 0.5701 - val_loss: 0.6801 - val_acc: 0.5684\n",
      "2400/2462 [============================>.] - ETA: 0s\n",
      " test IC: 0.235388769235\n",
      "\n",
      " alpha of long/short first 100 is  10.04%\n",
      "\n",
      " long return is -5.12%\n",
      "\n",
      " short return is -15.15%\n",
      "\n",
      " alpha of long/short first 50 is  14.36%\n",
      "\n",
      " long return is -1.78%\n",
      "\n",
      " short return is -16.14%\n",
      "起始时间：20120808\n",
      "换仓日： 20150825\n",
      "(2423, 21)\n",
      "Train on 42350 samples, validate on 10588 samples\n",
      "Epoch 1/100\n",
      "42350/42350 [==============================] - 3s - loss: 0.6950 - acc: 0.5240 - val_loss: 0.6804 - val_acc: 0.5728\n",
      "Epoch 2/100\n",
      "42350/42350 [==============================] - 0s - loss: 0.6874 - acc: 0.5471 - val_loss: 0.6781 - val_acc: 0.5801\n",
      "Epoch 3/100\n",
      "42350/42350 [==============================] - 1s - loss: 0.6845 - acc: 0.5561 - val_loss: 0.6796 - val_acc: 0.5757\n",
      "Epoch 4/100\n",
      "42350/42350 [==============================] - 0s - loss: 0.6844 - acc: 0.5570 - val_loss: 0.6790 - val_acc: 0.5803\n",
      "Epoch 5/100\n",
      "42350/42350 [==============================] - 0s - loss: 0.6827 - acc: 0.5606 - val_loss: 0.6784 - val_acc: 0.5836\n",
      "2423/2423 [==============================] - 0s     \n",
      "\n",
      " test IC: 0.161740471318\n",
      "\n",
      " alpha of long/short first 100 is  11.31%\n",
      "\n",
      " long return is 7.19%\n",
      "\n",
      " short return is -4.12%\n",
      "\n",
      " alpha of long/short first 50 is  11.38%\n",
      "\n",
      " long return is 8.23%\n",
      "\n",
      " short return is -3.15%\n"
     ]
    }
   ],
   "source": [
    "if __name__=='__main__':  \n",
    "    ###导入全历史因子训练数据\n",
    "    path1='/home/jovyan/work/'\n",
    "    os.chdir(path1)\n",
    "    FacData = pandas.read_csv('Train1.csv',engine='python')\n",
    "    FacData2 = pandas.read_csv('Train2.csv',engine='python')\n",
    "    FacData3 = pandas.read_csv('Train3.csv',engine='python')\n",
    "    #FacData4 =  pandas.read_csv('train4.csv',engine='python', skipfooter=3)  \n",
    "   \n",
    "\n",
    "    FacData=FacData.append(FacData2)\n",
    "    FacData=FacData.append(FacData3)\n",
    "    #FacData=FacData.append(FacData4)\n",
    "    \n",
    "    ####换仓日列表\n",
    "    AdDay=pandas.read_csv('adjustDay.csv',engine='python',skipfooter=3)           \n",
    "    DayList=np.array(AdDay['Start']).astype(str)\n",
    "    print(len(DayList))\n",
    "    #Period=22      #持仓期间22天\n",
    "\n",
    "    #####导入历史股票分档数据，持仓期间收益表现前30%标为1，后30%标为0######\n",
    "    Label=pandas.read_csv('Label2.csv',engine='python')\n",
    "    Y_data=Label.rename(columns={'tdate': 'Date','symbol':'Symbol'})\n",
    "    \n",
    "    #将标签数据与因子数据合成训练数据\n",
    "    TrainData=pandas.merge(FacData,Y_data,how='inner',on=['Date','Symbol'])\n",
    "    print(\"训练数据长度: \"+str(len(TrainData)))\n",
    "    #dataframe = pandas.read_csv(\"inte.csv\",usecols=[1], engine='python', skipfooter=3)\n",
    "    fac_num=FacData.shape[1]-2\n",
    "    print(\"Factor个数为：\"+str(fac_num))\n",
    "    #FacData.head()\n",
    "\n",
    "    #将持仓期间全市场股票收益率与换仓日因子数据合成测试数据集，每次测试只看换仓日当天数据，无标签数据\n",
    "    Ret_all=pandas.read_csv('Return.csv',engine='python')\n",
    "    Ret_all=Ret_all.rename(columns={'tdate': 'Date','symbol':'Symbol'})\n",
    "    TestData=pandas.merge(FacData,Ret_all,how='inner',on=['Date','Symbol'])\n",
    "    len(TestData)\n",
    "    \n",
    "    np.random.seed(123)\n",
    "    #####Parameter\n",
    "    nb_cl=2#####输出股票分组个数\n",
    "    dim=[fac_num,100,100,100]\n",
    "    #print(os.getcwd())\n",
    "    path2='/home/jovyan/work/backtest_dnn/21 factor test/'\n",
    "    os.chdir(path2)\n",
    "\n",
    "#(len(DayList)-12*3-2)\n",
    "\n",
    "    alpha100=[]\n",
    "    alpha50=[]\n",
    "    testIC=[]\n",
    "    testDate=[]\n",
    "    long100=[]\n",
    "    short100=[]\n",
    "   \n",
    "\n",
    "    np.random.seed(123)\n",
    "    for i in range(45,len(DayList)-12*3-2):\n",
    "        S_day=DayList[i]#滚动回测期间第一个换仓日\n",
    "        L_day=DayList[i+3*12+1] #滚动回测期间最后一个换仓日，预测日\n",
    "        \n",
    "        Sday=int(S_day)-1\n",
    "        Lday=int(L_day)\n",
    "        testDate.append(Lday)\n",
    "        print(\"起始时间：\"+str(S_day))\n",
    "        print(\"换仓日： \"+str(L_day))\n",
    "        ###构建滚动回测窗口，用三年期训练数据集有监督训练整个神经网络\n",
    "        ###换仓日当天因子数据作为测试数据预测下一期股票分类\n",
    "\n",
    "        Retu,(x_train,y_train),x_test=process_data(TrainData,TestData,Sday,Lday,fac_num)\n",
    "        Train_Y= np_utils.to_categorical(y_train, nb_cl)   ###将训练标签转换成kera适应的categorical形式\n",
    "        #Test_Y=np_utils.to_categorical(y_test, nb_cl)\n",
    "        print(x_test.shape)\n",
    "        #Train_Y[0:50]\n",
    "\n",
    "        model=neural_network(dim,nb_cl,loss='categorical_crossentropy', optimizer='adadelta')   \n",
    "\n",
    "    #####用窗口期间历史因子训练整张网络########\n",
    "        early_stopping=EarlyStopping(monitor='val_loss', patience=2)\n",
    "        model.fit(x_train, Train_Y,\n",
    "                    nb_epoch=100,\n",
    "                    batch_size=1000,\n",
    "                    shuffle=True,\n",
    "                    validation_split=.2,callbacks=[early_stopping])\n",
    "        \n",
    "        \n",
    "        train_score=model.evaluate(x_train[.8*len(x_train):len(x_train)],\n",
    "                               Train_Y[.8*len(x_train):len(x_train)],batch_size=1000)\n",
    "        print(\"Train_score is: \"+str(train_score))\n",
    "        classes = model.predict_classes(x_train)\n",
    "        proba = model.predict_proba(x_train)\n",
    "        accuracy = np.mean(classes==y_train)\n",
    "        print(\"\\n Training Accuracy: %.2f%%\" % (accuracy*100))  \n",
    "        #predictions = [float(round(x)) for x in list(probabilities)]\n",
    "        accuracy = np.sum([1 for m,k in zip(classes,y_train) if k==m==0])/np.sum([1 for k in y_train if k==0])\n",
    "        print(\"\\n Training 0-class Accuracy: %.2f%%\" % (accuracy*100))\n",
    "        accuracy = np.sum([1 for m,k in zip(classes,y_train) if k==m==1])/np.sum([1 for k in y_train if k==1])\n",
    "        print(\"\\n Training 1-class Accuracy: %.2f%%\" % (accuracy*100))\n",
    "        ####在测试集上做预测，输出股票分类和概率\n",
    "        \n",
    "        classes2 = model.predict_classes(x_test)\n",
    "        proba2 = model.predict_proba(x_test)\n",
    "        #print(proba2[0:50])\n",
    "        #print(classes2[0:50])\n",
    "        pred1=proba2[:,1]\n",
    "        pred0=proba2[:,0]\n",
    "        Retu['proba1']=pred1\n",
    "        Retu['proba0']=pred0\n",
    "        print ('\\n test IC:',np.corrcoef(pred1,Retu['Return'])[0][1])\n",
    "        testIC.append(np.corrcoef(pred1,Retu['Return'])[0][1])\n",
    "        #print(pred0)\n",
    "        Retu.to_csv(path2+'long_cnn '+ str(Lday) +'.csv')\n",
    "        #print(Retu)\n",
    "        alpha1,alpha2,long,short=backtest(Retu)\n",
    "        alpha100.append(alpha1)\n",
    "        alpha50.append(alpha2)\n",
    "        long100.append(long)\n",
    "        short100.append(short)\n",
    "    ###end of loop\n",
    "      \n",
    "\n",
    "        #print(alpha100)\n",
    "        #print(testIC)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7.886490793463007\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAAEACAYAAAB4ayemAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VGXWwPHfk0LovbfQq/TeB1a6oq669gIr6quiK6+7\n1leQXdFdFMVFVl3AgoKKqwJuqEIgAQMEQu8EElpCQkilpMx5/7ihl8xMMpmS8/187ieTmzt3zmPw\n8HDuU4yIoJRSyjcEeDoApZRSjtOkrZRSPkSTtlJK+RBN2kop5UM0aSullA/RpK2UUj7EoaRtjHnR\nGLPDGLPNGPONMaaUuwNTSil1rQKTtjGmLjAO6Cwi7YEg4H53B6aUUupaQQ5eFwiUM8bYgbLAcfeF\npJRS6kYK7GmLyHHgfSAeOAakisgKdwemlFLqWo6URyoDdwChQF2gvDHmQXcHppRS6lqOlEduBWJF\nJAXAGPMj0BuYe/lFxhhdxEQppZwkIsaZ6x0ZPRIP9DTGlDbGGOB3wO4bfLhfHhMmTPB4DNo+bZ+2\nz/8OVzhS094A/ADEAFsBA3zm0qcppZSfePhhOHq0+D/XoXHaIvKWiLQWkfYi8piI5Lg7MKWU8lbH\nj0NYGNSuXfyfrTMiHWCz2Twdgltp+3ybtq/4LVsGt94KQY4Omi5CxtW6yjU3MkaK6l5KKeXN7r8f\n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MP+dP7TsEVLvqnF+0D6gIHLzOeafaV9jySEmZeFNTRBIB\nRCQBqOnheIqEMaYRVo80CusPjc+3Mb90EAMkAMtFZCN+0rZ8HwB/Bi5/GOVP7RNguTFmozHmifxz\n/tK+xkCyMebz/PLWZ8aYsjjZPp1c4xqff3prjCkP/AC8ICKZXNsmn2yjiNjFKo/UB7obY9riJ20z\nxowEEkVkC3Czsb0+2b58fUSkMzACq3TXDz/5/WGN1usMfJzfxiys6oRT7Sts0j4GNLzs+/r55/xN\nojGmFoAxpjZw0sPxFIoxJggrYc8RkQX5p/2qjSKSDoQDw/CftvUBRhljYoF5wCBjzBwgwU/ah4ic\nyP+ahFW6647//P6OAkdEJDr/+/9gJXGn2lfYpL0RaGaMCTXGlALuBxYW8p7ewHBlT2Yh8Hj+68eA\nBVe/wcfMBnaJyLTLzvl8G40x1S88eTfGlAEGA7vxg7YBiMhrItJQRJpg/b+2UkQeARbhB+0zxpTN\n/xcgxphywBBgO/7z+0sEjhhjWuSf+h2wE2fbVwTF9WFYMyb3A694uthfBO2ZCxwHzgPxwGigCrAi\nv53LgMqejrMQ7esD5AFbgBhgc/7vsKqvtxFol9+eLcA24PX88z7ftuu0dQCXHkT6Rfuwar4X/lxu\nv5BP/KV9+W3pgNXZ3QL8CFRytn06uUYppXyIPohUSikfoklbKaV8iCZtpZTyIZq0lVLKh2jSVkop\nH6JJWymlfIgmbaWU8iGatJVSyof8P2Fh90FdYNLkAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fc1e87dde48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "######Plot Cummulative NAV#######\n",
    "\n",
    "def nav(y):\n",
    "    nav=[1]\n",
    "    for k in range(len(y)):\n",
    "        nav.append(nav[k]*(1+y[k]))\n",
    "    return nav\n",
    "\n",
    "nav_alpha=nav(alpha100)\n",
    "nav_long=nav(long100)\n",
    "    \n",
    "\n",
    "plt.plot(nav_alpha,color='blue',label='alpha')\n",
    "plt.plot(nav_long,color='green',label='long')\n",
    "print(nav_alpha[-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "    <div class=\"bk-banner\">\n",
       "        <a href=\"http://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n",
       "        <span id=\"17cff28c-17fb-42f1-9295-4b677bd11d9b\">Loading BokehJS ...</span>\n",
       "    </div>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/javascript": [
       "\n",
       "(function(global) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  if (typeof (window._bokeh_onload_callbacks) === \"undefined\") {\n",
       "    window._bokeh_onload_callbacks = [];\n",
       "  }\n",
       "\n",
       "  function run_callbacks() {\n",
       "    window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "    delete window._bokeh_onload_callbacks\n",
       "    console.info(\"Bokeh: all callbacks have finished\");\n",
       "  }\n",
       "\n",
       "  function load_libs(js_urls, callback) {\n",
       "    window._bokeh_onload_callbacks.push(callback);\n",
       "    if (window._bokeh_is_loading > 0) {\n",
       "      console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "      return null;\n",
       "    }\n",
       "    if (js_urls == null || js_urls.length === 0) {\n",
       "      run_callbacks();\n",
       "      return null;\n",
       "    }\n",
       "    console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "    window._bokeh_is_loading = js_urls.length;\n",
       "    for (var i = 0; i < js_urls.length; i++) {\n",
       "      var url = js_urls[i];\n",
       "      var s = document.createElement('script');\n",
       "      s.src = url;\n",
       "      s.async = false;\n",
       "      s.onreadystatechange = s.onload = function() {\n",
       "        window._bokeh_is_loading--;\n",
       "        if (window._bokeh_is_loading === 0) {\n",
       "          console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "          run_callbacks()\n",
       "        }\n",
       "      };\n",
       "      s.onerror = function() {\n",
       "        console.warn(\"failed to load library \" + url);\n",
       "      };\n",
       "      console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "      document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "    }\n",
       "  };\n",
       "\n",
       "  var js_urls = ['https://cdn.pydata.org/bokeh/release/bokeh-0.11.1.min.js', 'https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.11.1.min.js', 'https://cdn.pydata.org/bokeh/release/bokeh-compiler-0.11.1.min.js'];\n",
       "\n",
       "  var inline_js = [\n",
       "    function(Bokeh) {\n",
       "      Bokeh.set_log_level(\"info\");\n",
       "    },\n",
       "    \n",
       "    function(Bokeh) {\n",
       "      Bokeh.$(\"#17cff28c-17fb-42f1-9295-4b677bd11d9b\").text(\"BokehJS successfully loaded\");\n",
       "    },\n",
       "    function(Bokeh) {\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-0.11.1.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-0.11.1.min.css\");\n",
       "      console.log(\"Bokeh: injecting CSS: https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.11.1.min.css\");\n",
       "      Bokeh.embed.inject_css(\"https://cdn.pydata.org/bokeh/release/bokeh-widgets-0.11.1.min.css\");\n",
       "    }\n",
       "  ];\n",
       "\n",
       "  function run_inline_js() {\n",
       "    for (var i = 0; i < inline_js.length; i++) {\n",
       "      inline_js[i](window.Bokeh);\n",
       "    }\n",
       "  }\n",
       "\n",
       "  if (window._bokeh_is_loading === 0) {\n",
       "    console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "    run_inline_js();\n",
       "  } else {\n",
       "    load_libs(js_urls, function() {\n",
       "      console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "      run_inline_js();\n",
       "    });\n",
       "  }\n",
       "}(this));"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "    <div class=\"plotdiv\" id=\"a2bb327c-9fbc-4fee-9b21-61142b24c8dc\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  \n",
       "  (function(global) {\n",
       "    function now() {\n",
       "      return new Date();\n",
       "    }\n",
       "  \n",
       "    if (typeof (window._bokeh_onload_callbacks) === \"undefined\") {\n",
       "      window._bokeh_onload_callbacks = [];\n",
       "    }\n",
       "  \n",
       "    function run_callbacks() {\n",
       "      window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "      delete window._bokeh_onload_callbacks\n",
       "      console.info(\"Bokeh: all callbacks have finished\");\n",
       "    }\n",
       "  \n",
       "    function load_libs(js_urls, callback) {\n",
       "      window._bokeh_onload_callbacks.push(callback);\n",
       "      if (window._bokeh_is_loading > 0) {\n",
       "        console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "        return null;\n",
       "      }\n",
       "      if (js_urls == null || js_urls.length === 0) {\n",
       "        run_callbacks();\n",
       "        return null;\n",
       "      }\n",
       "      console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "      window._bokeh_is_loading = js_urls.length;\n",
       "      for (var i = 0; i < js_urls.length; i++) {\n",
       "        var url = js_urls[i];\n",
       "        var s = document.createElement('script');\n",
       "        s.src = url;\n",
       "        s.async = false;\n",
       "        s.onreadystatechange = s.onload = function() {\n",
       "          window._bokeh_is_loading--;\n",
       "          if (window._bokeh_is_loading === 0) {\n",
       "            console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "            run_callbacks()\n",
       "          }\n",
       "        };\n",
       "        s.onerror = function() {\n",
       "          console.warn(\"failed to load library \" + url);\n",
       "        };\n",
       "        console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      }\n",
       "    };var element = document.getElementById(\"a2bb327c-9fbc-4fee-9b21-61142b24c8dc\");\n",
       "    if (element == null) {\n",
       "      console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'a2bb327c-9fbc-4fee-9b21-61142b24c8dc' but no matching script tag was found. \")\n",
       "      return false;\n",
       "    }\n",
       "  \n",
       "    var js_urls = [];\n",
       "  \n",
       "    var inline_js = [\n",
       "      function(Bokeh) {\n",
       "        Bokeh.$(function() {\n",
       "            var docs_json = {\"6c8067dd-d779-4ee8-8c74-9674cd127345\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"1dadb927-c5cd-4876-a9df-7bd3fd9ece4a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"blue\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"94e1a07f-65dc-4ed2-9bba-795b3715cc65\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"18d15973-03e4-4425-94f8-13d3b3bf9f20\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"943ff7cf-a0b3-46c2-9b87-fb659f8a6198\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"568b7d82-8b79-4000-b0b3-9ce979a14664\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3a46ac48-e324-4a68-a74c-ac6505b04780\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"7b8b1d0f-40eb-4905-963c-f30be4e2a811\",\"type\":\"PreviewSaveTool\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"55fbcd8d-4105-48e2-ab7c-fe0e7ae408d8\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"d29c4860-f00b-47e0-a3e5-e3bad211b501\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"25bc3af7-7ab8-477f-a910-33a602582e23\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"551c4af6-aaa9-403d-8ffd-7ac314757355\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"overlay\":{\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"0c265bf3-9f01-46dc-b0de-0d98dc26e810\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"acf8624b-4277-4c06-9211-2e73b2a88d82\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"568b7d82-8b79-4000-b0b3-9ce979a14664\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"orange\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"943ff7cf-a0b3-46c2-9b87-fb659f8a6198\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"3041a231-b9ec-46d4-a12f-b83925dd837d\",\"type\":\"ToolEvents\"},{\"attributes\":{\"data_source\":{\"id\":\"5b41159e-fcf1-482a-9bbd-5eed58605f19\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"94e1a07f-65dc-4ed2-9bba-795b3715cc65\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"899b315b-a157-40ec-a693-d6783b0acc08\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"fb4c1f3f-7973-429e-b20c-84fbc84f54f4\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"f6591b61-cf37-42e8-bb08-9f285bb254cf\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"}},\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"a15f1388-a984-44fb-9983-8567ee85cba7\",\"type\":\"ResizeTool\"},{\"attributes\":{\"data_source\":{\"id\":\"e2c178fc-307d-4ec5-9ee9-246fff42cdc7\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6987def8-38b8-4c6d-9d3a-9577a15ea9d8\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"aa9d0b2b-0d1a-428f-84bd-4b4c1f994172\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"legends\":[[\"alpha100\",[{\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"}]],[\"alpha50\",[{\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"}]],[\"long100\",[{\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"}]]],\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"aec8a12a-abe3-4f98-bc1b-21aa6b489d42\",\"type\":\"Legend\"},{\"attributes\":{\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"}},\"id\":\"ecf890ca-8c6a-4746-ac10-1e65b80b8705\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"5e14208a-9fcd-41fd-b35b-05ee0b203731\",\"type\":\"DataRange1d\"},{\"attributes\":{\"dimension\":1,\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"}},\"id\":\"a03d1ed3-1335-4b37-830c-0226be7c76fc\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"899b315b-a157-40ec-a693-d6783b0acc08\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"3a46ac48-e324-4a68-a74c-ac6505b04780\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"}},\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"blue\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6987def8-38b8-4c6d-9d3a-9577a15ea9d8\",\"type\":\"Line\"},{\"attributes\":{\"below\":[{\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":900,\"renderers\":[{\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"},{\"id\":\"ecf890ca-8c6a-4746-ac10-1e65b80b8705\",\"type\":\"Grid\"},{\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"},{\"id\":\"a03d1ed3-1335-4b37-830c-0226be7c76fc\",\"type\":\"Grid\"},{\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},{\"id\":\"aec8a12a-abe3-4f98-bc1b-21aa6b489d42\",\"type\":\"Legend\"},{\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"},{\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"},{\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"}],\"title\":\"Alpha of long/short by DNN\",\"tool_events\":{\"id\":\"255f1ed8-1817-4bea-8d9a-d248167ab802\",\"type\":\"ToolEvents\"},\"tools\":[{\"id\":\"a3283ae5-d83d-4326-a623-71b60610ed05\",\"type\":\"PanTool\"},{\"id\":\"41d90305-9961-437e-b81a-d2ffdca10e58\",\"type\":\"WheelZoomTool\"},{\"id\":\"f8c8d8fd-bb8e-46dd-9604-d32bd58060b1\",\"type\":\"BoxZoomTool\"},{\"id\":\"60b9a717-0fc3-441a-a1a4-bbef97478361\",\"type\":\"PreviewSaveTool\"},{\"id\":\"a15f1388-a984-44fb-9983-8567ee85cba7\",\"type\":\"ResizeTool\"},{\"id\":\"d1f5245c-06f3-49ff-8614-da0e568159e2\",\"type\":\"ResetTool\"},{\"id\":\"e6750762-3873-472b-b166-0404d8b4ebed\",\"type\":\"HelpTool\"}],\"x_range\":{\"id\":\"b0f127d0-9f5d-4f0e-a31d-29bc937e119e\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"5e14208a-9fcd-41fd-b35b-05ee0b203731\",\"type\":\"DataRange1d\"}},\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"d1f5245c-06f3-49ff-8614-da0e568159e2\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1dadb927-c5cd-4876-a9df-7bd3fd9ece4a\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"}},\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.05306181666874978,0.09467546949146434,0.002342753826899399,-0.027238409383948593,0.0012035340209464174,0.022646916596573585,0.054853315481011966,0.09097810856396119,-0.005458470357716197,0.05484141500412662,0.023051292700560694,-0.01839458785267603,0.10672028454522842,0.05646901047303457,0.07110074762513482,-0.03119974882545369,0.01572973511170962,-0.0018220477558412024,0.010055728330248155,0.10548258419041594,0.021591689478919797,0.09436536634795344,0.0034181401167152348,0.004863326554968517,0.10522123247658557,0.0737338451094778,0.05581213491807141,0.09155708684031583,0.008467144074454543,-0.05715732985631199,-0.01918820728616158,0.06213403837899944,-0.06396194351349761,0.16216465778932382,0.029862071136332206,0.025094044650723808,-0.08702444156324118,0.10723368138692901,0.08052227613050819,0.07682542481303621,0.014593485024085417,0.020979572151452103,0.09266765171061843,0.1010526359659648,0.0324941459013986,0.017356554780281013,-0.0026040361808371965,-0.21113522281725292,0.13601718379640707,0.008915526018755005,0.019209666597051978,0.14181152357811916,0.18998156932912816,0.2059980021358327,0.04339780533954085,0.1713394702584166,0.15234026358054809]}},\"id\":\"d29c4860-f00b-47e0-a3e5-e3bad211b501\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"60b9a717-0fc3-441a-a1a4-bbef97478361\",\"type\":\"PreviewSaveTool\"},{\"attributes\":{\"legends\":[[\"alpha100\",[{\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"}]],[\"alpha50\",[{\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"}]]],\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"8fead27e-057b-45d0-885f-476f632641de\",\"type\":\"Legend\"},{\"attributes\":{\"formatter\":{\"id\":\"acf8624b-4277-4c06-9211-2e73b2a88d82\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"}},\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"255f1ed8-1817-4bea-8d9a-d248167ab802\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[1.0,1.0582022270232716,1.1344555328377217,1.150385796450307,1.071719787095604,0.9757201605083474,1.1069564989079355,1.02698517305031,1.0440199659310279,1.006871896925854,1.0471958948239315,0.9512519105856722,0.8368870595118069,0.9215792364813269,1.036892786418623,1.0002840540313387,1.0112814310397094,1.0015593209424007,0.9498856666192875,0.9527269024909604,0.9790734086252341,1.0186773269063778,0.9975860770709333,0.8958386230778594,1.05362997241951,1.110842187040253,1.1972694702829774,1.159259591296055,1.2289539465174484,1.1972727110137549,1.1502955400484274,1.2056119776734457,1.3203892926655862,1.4012374527621458,1.3534272802040372,1.4601277299491764,1.4172226310456568,1.483891512087933,1.4806219771511855,1.5748004368772337,1.5267096772980089,1.616616021706449,1.7394534800427746,1.9182102466036783,2.0999029547897026,2.3856211129727063,2.511054674716383,2.627698380686602,2.4051807807471763,2.7122646448642347,2.9891486435453563,3.6814821799235533,4.317638253132642,5.990059973469138,5.7445604189555,4.775948731889229,4.576977476957752,4.9377564197013015]}},\"id\":\"18d15973-03e4-4425-94f8-13d3b3bf9f20\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"}},\"id\":\"c3da3857-351f-4acc-9a02-875c59d054df\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"997ff215-9da4-4a28-b3f2-253e58b763f6\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null},\"id\":\"e762706b-d4e5-4771-9144-97a164ceba43\",\"type\":\"DataRange1d\"},{\"attributes\":{\"below\":[{\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":900,\"renderers\":[{\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"},{\"id\":\"b354cec4-a545-4d27-9ff2-33ade55fe4cb\",\"type\":\"Grid\"},{\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"},{\"id\":\"c3da3857-351f-4acc-9a02-875c59d054df\",\"type\":\"Grid\"},{\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},{\"id\":\"8fead27e-057b-45d0-885f-476f632641de\",\"type\":\"Legend\"},{\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"},{\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"}],\"title\":\"Alpha NAV of long/short by DNN\",\"tool_events\":{\"id\":\"3041a231-b9ec-46d4-a12f-b83925dd837d\",\"type\":\"ToolEvents\"},\"tools\":[{\"id\":\"997ff215-9da4-4a28-b3f2-253e58b763f6\",\"type\":\"PanTool\"},{\"id\":\"af85b8d2-0128-46c6-8a52-85a470db5e7f\",\"type\":\"WheelZoomTool\"},{\"id\":\"0c265bf3-9f01-46dc-b0de-0d98dc26e810\",\"type\":\"BoxZoomTool\"},{\"id\":\"7b8b1d0f-40eb-4905-963c-f30be4e2a811\",\"type\":\"PreviewSaveTool\"},{\"id\":\"3a2b45c2-5c1a-47af-b791-f1957865d6ba\",\"type\":\"ResizeTool\"},{\"id\":\"ca1ef4e8-9f5f-4daa-842f-1e60327b2a8b\",\"type\":\"ResetTool\"},{\"id\":\"55fbcd8d-4105-48e2-ab7c-fe0e7ae408d8\",\"type\":\"HelpTool\"}],\"x_range\":{\"id\":\"e762706b-d4e5-4771-9144-97a164ceba43\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"fb4c1f3f-7973-429e-b20c-84fbc84f54f4\",\"type\":\"DataRange1d\"}},\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"b0f127d0-9f5d-4f0e-a31d-29bc937e119e\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"ca1ef4e8-9f5f-4daa-842f-1e60327b2a8b\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"aa9d0b2b-0d1a-428f-84bd-4b4c1f994172\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"af85b8d2-0128-46c6-8a52-85a470db5e7f\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"a3283ae5-d83d-4326-a623-71b60610ed05\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3a2b45c2-5c1a-47af-b791-f1957865d6ba\",\"type\":\"ResizeTool\"},{\"attributes\":{\"line_color\":{\"value\":\"red\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e30bbf9c-1689-4540-8a6a-670e075538c5\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"551c4af6-aaa9-403d-8ffd-7ac314757355\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"41d90305-9961-437e-b81a-d2ffdca10e58\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"e6750762-3873-472b-b166-0404d8b4ebed\",\"type\":\"HelpTool\"},{\"attributes\":{\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"}},\"id\":\"b354cec4-a545-4d27-9ff2-33ade55fe4cb\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"f8c8d8fd-bb8e-46dd-9604-d32bd58060b1\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.0582022270232716,0.07205929440249909,0.014042210691799997,-0.06838228496686867,-0.08957530479811203,0.13450202600222397,-0.07224432571336002,0.01658718482772432,-0.0355817610940479,0.0400487867634336,-0.09161990102567258,-0.1202256203653274,0.10119905189945787,0.12512602863924496,-0.0353061887080236,0.010994254046187462,-0.009613654319068387,-0.05159320395969333,0.0029911345875815003,0.027653786269065294,0.0404504074283393,-0.02070454429323218,-0.10199365882473019,0.17613814059447697,0.054300101666017904,0.07780338580136467,-0.031747137908676976,0.06011971412155842,-0.025779025807655703,-0.0392368175881592,0.04808889167968907,0.09520253374857328,0.06123054810096508,-0.03411996479530591,0.0788372240650072,-0.029384483304767495,0.047041925228844504,-0.0022033517343509014,0.0636073631078028,-0.030537684936503294,0.0588889595352258,0.07598431333537209,0.10276605187309054,0.09471991326692346,0.13606255352482102,0.05257899549160789,0.04645207734610302,-0.08468156070533599,0.12767600114518704,0.10208590787975319,0.231615626701333,0.17279890058364977,0.38734642003022807,-0.04098449023899438,-0.168613717399527,-0.04166109522971571,0.07882471446710158]}},\"id\":\"503bd608-ec31-4099-b031-0a0a518edb13\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"503bd608-ec31-4099-b031-0a0a518edb13\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e30bbf9c-1689-4540-8a6a-670e075538c5\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"fa57b1ce-9e33-4f3f-8087-7157c9b342b4\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fa57b1ce-9e33-4f3f-8087-7157c9b342b4\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"f6591b61-cf37-42e8-bb08-9f285bb254cf\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"orange\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"25bc3af7-7ab8-477f-a910-33a602582e23\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[1.0,1.0347770995995975,1.1264991119627437,1.1365537263648688,1.1161135207318722,1.1286342211550007,1.1643193542458394,1.2208901454809922,1.324212160784313,1.3419730810304917,1.4199749818371659,1.4440902508260351,1.4270014242007678,1.5663250887981115,1.6234917204083708,1.7263219222990236,1.7154028821090814,1.7632604886134462,1.754071361513525,1.8069708565021123,2.0260438824626634,2.0678283900725543,2.222735043450716,2.2014478851753108,2.195976935079233,2.3905463047845394,2.4881999059354665,2.561578219185802,2.6617201851889636,2.6766017332378444,2.5153495760723095,2.4409658761822266,2.5339680915482594,2.4308389737530565,2.787784185124254,2.8415122017554393,2.878041532598836,2.6116450972442684,2.8615111376620606,3.0114341673667915,3.2210185038205337,3.293109464504718,3.307706830809645,3.622316400290315,3.9127883247943567,3.9800293688607287,4.113053011152808,4.047760166775552,3.341247520222146,3.817285536732752,3.905217528332271,3.9241007135918125,4.320595045855887,5.177061176015417,5.9911646996844325,6.188760337017731,7.175739137270957,7.886490793463007]}},\"id\":\"e2c178fc-307d-4ec5-9ee9-246fff42cdc7\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.03477709959959756,0.08863939141930906,0.008925541347836994,-0.01798437254556559,0.011218124492317127,0.03161797898908299,0.04858700581490835,0.08462842925365341,0.013412443090433102,0.05812478797769691,0.016982883006621083,-0.011833627860511023,0.09763386513463067,0.03649729677389328,0.06333891365013376,-0.006325031298566042,0.027898756031891618,-0.005211440487246019,0.030158120216353175,0.12123771956379377,0.020623693283040607,0.07491272202367169,-0.00957701114135405,-0.0024851599408367286,0.08860264723057582,0.040849909895273165,0.029490521672031034,0.03909385442658543,0.005590951344806576,-0.060245106757242706,-0.029571913422162234,0.03810057988663577,-0.04069866473030094,0.14684033587798603,0.019272659956204863,0.01285559527804581,-0.09256170640248376,0.09567381137714455,0.05239295690011635,0.06959618733322773,0.022381417740592102,0.004432699994417755,0.09511410338734924,0.08018955066453085,0.017184942931945002,0.0334227790711397,-0.01587454482113674,-0.17454409783280575,0.14247313724274957,0.02303521461870539,0.004835373477288879,0.10104081449559814,0.19822874420527156,0.15725205787419333,0.03298117264973635,0.1594792408343342,0.09904926065391494]}},\"id\":\"5b41159e-fcf1-482a-9bbd-5eed58605f19\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"eb733da0-94d2-4f2e-8228-db822a2757a0\"]},\"title\":\"Bokeh Application\",\"version\":\"0.11.1\"}};\n",
       "            var render_items = [{\"docid\":\"6c8067dd-d779-4ee8-8c74-9674cd127345\",\"elementid\":\"a2bb327c-9fbc-4fee-9b21-61142b24c8dc\",\"modelid\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"notebook_comms_target\":\"ebb76fd4-73ee-4b00-ae04-b3549efc0fdc\"}];\n",
       "            \n",
       "            Bokeh.embed.embed_items(docs_json, render_items);\n",
       "        });\n",
       "      },\n",
       "      function(Bokeh) {\n",
       "      }\n",
       "    ];\n",
       "  \n",
       "    function run_inline_js() {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i](window.Bokeh);\n",
       "      }\n",
       "    }\n",
       "  \n",
       "    if (window._bokeh_is_loading === 0) {\n",
       "      console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "      run_inline_js();\n",
       "    } else {\n",
       "      load_libs(js_urls, function() {\n",
       "        console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "        run_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }(this));\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<p><code>&lt;Bokeh Notebook handle for <strong>In[36]</strong>&gt;</code></p>"
      ],
      "text/plain": [
       "<bokeh.io._CommsHandle at 0x7fc1d3666c50>"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from bokeh.plotting import figure, output_notebook, show,output_file\n",
    "from math import pi\n",
    "output_notebook()\n",
    "\n",
    "p = figure(plot_width=900, plot_height=400)\n",
    "\n",
    "p.title = \"Alpha NAV of long/short by DNN\"\n",
    "p.xaxis.major_label_orientation = pi/4\n",
    "p.grid.grid_line_alpha=0.3\n",
    "index=[i for i in range(len(testDate))]\n",
    "#tY_exp=dataset[train_size:len(dataset)]\n",
    "#testP=convert(testPredict)\n",
    "#print(testP)\n",
    "#print(testPredict)\n",
    "#int(testP)\n",
    "#testY=testY\n",
    "#print(dataO,trainpredict,testpredict)\n",
    "#p.line(x=index,y=dataO, color=\"blue\")\n",
    "p.line(x=index,y=nav_alpha,color=\"blue\",legend=\"alpha100\")\n",
    "p.line(x=index, y=nav_long,color=\"orange\",legend=\"alpha50\")\n",
    "show(p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "\n",
       "    <div class=\"plotdiv\" id=\"f358ccfc-413e-4b2e-b750-d20e802dabef\"></div>\n",
       "<script type=\"text/javascript\">\n",
       "  \n",
       "  (function(global) {\n",
       "    function now() {\n",
       "      return new Date();\n",
       "    }\n",
       "  \n",
       "    if (typeof (window._bokeh_onload_callbacks) === \"undefined\") {\n",
       "      window._bokeh_onload_callbacks = [];\n",
       "    }\n",
       "  \n",
       "    function run_callbacks() {\n",
       "      window._bokeh_onload_callbacks.forEach(function(callback) { callback() });\n",
       "      delete window._bokeh_onload_callbacks\n",
       "      console.info(\"Bokeh: all callbacks have finished\");\n",
       "    }\n",
       "  \n",
       "    function load_libs(js_urls, callback) {\n",
       "      window._bokeh_onload_callbacks.push(callback);\n",
       "      if (window._bokeh_is_loading > 0) {\n",
       "        console.log(\"Bokeh: BokehJS is being loaded, scheduling callback at\", now());\n",
       "        return null;\n",
       "      }\n",
       "      if (js_urls == null || js_urls.length === 0) {\n",
       "        run_callbacks();\n",
       "        return null;\n",
       "      }\n",
       "      console.log(\"Bokeh: BokehJS not loaded, scheduling load and callback at\", now());\n",
       "      window._bokeh_is_loading = js_urls.length;\n",
       "      for (var i = 0; i < js_urls.length; i++) {\n",
       "        var url = js_urls[i];\n",
       "        var s = document.createElement('script');\n",
       "        s.src = url;\n",
       "        s.async = false;\n",
       "        s.onreadystatechange = s.onload = function() {\n",
       "          window._bokeh_is_loading--;\n",
       "          if (window._bokeh_is_loading === 0) {\n",
       "            console.log(\"Bokeh: all BokehJS libraries loaded\");\n",
       "            run_callbacks()\n",
       "          }\n",
       "        };\n",
       "        s.onerror = function() {\n",
       "          console.warn(\"failed to load library \" + url);\n",
       "        };\n",
       "        console.log(\"Bokeh: injecting script tag for BokehJS library: \", url);\n",
       "        document.getElementsByTagName(\"head\")[0].appendChild(s);\n",
       "      }\n",
       "    };var element = document.getElementById(\"f358ccfc-413e-4b2e-b750-d20e802dabef\");\n",
       "    if (element == null) {\n",
       "      console.log(\"Bokeh: ERROR: autoload.js configured with elementid 'f358ccfc-413e-4b2e-b750-d20e802dabef' but no matching script tag was found. \")\n",
       "      return false;\n",
       "    }\n",
       "  \n",
       "    var js_urls = [];\n",
       "  \n",
       "    var inline_js = [\n",
       "      function(Bokeh) {\n",
       "        Bokeh.$(function() {\n",
       "            var docs_json = {\"9faad303-e6fe-4b19-9978-1f8d97d9d8f3\":{\"roots\":{\"references\":[{\"attributes\":{},\"id\":\"1dadb927-c5cd-4876-a9df-7bd3fd9ece4a\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"blue\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"94e1a07f-65dc-4ed2-9bba-795b3715cc65\",\"type\":\"Line\"},{\"attributes\":{\"data_source\":{\"id\":\"18d15973-03e4-4425-94f8-13d3b3bf9f20\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"943ff7cf-a0b3-46c2-9b87-fb659f8a6198\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"568b7d82-8b79-4000-b0b3-9ce979a14664\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"},{\"attributes\":{},\"id\":\"3a46ac48-e324-4a68-a74c-ac6505b04780\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"7b8b1d0f-40eb-4905-963c-f30be4e2a811\",\"type\":\"PreviewSaveTool\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"55fbcd8d-4105-48e2-ab7c-fe0e7ae408d8\",\"type\":\"HelpTool\"},{\"attributes\":{\"data_source\":{\"id\":\"d29c4860-f00b-47e0-a3e5-e3bad211b501\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"25bc3af7-7ab8-477f-a910-33a602582e23\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"551c4af6-aaa9-403d-8ffd-7ac314757355\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"bottom_units\":\"screen\",\"fill_alpha\":{\"value\":0.5},\"fill_color\":{\"value\":\"lightgrey\"},\"left_units\":\"screen\",\"level\":\"overlay\",\"line_alpha\":{\"value\":1.0},\"line_color\":{\"value\":\"black\"},\"line_dash\":[4,4],\"line_width\":{\"value\":2},\"plot\":null,\"render_mode\":\"css\",\"right_units\":\"screen\",\"top_units\":\"screen\"},\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},{\"attributes\":{\"overlay\":{\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"0c265bf3-9f01-46dc-b0de-0d98dc26e810\",\"type\":\"BoxZoomTool\"},{\"attributes\":{},\"id\":\"acf8624b-4277-4c06-9211-2e73b2a88d82\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"568b7d82-8b79-4000-b0b3-9ce979a14664\",\"type\":\"Line\"},{\"attributes\":{\"line_color\":{\"value\":\"orange\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"943ff7cf-a0b3-46c2-9b87-fb659f8a6198\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"3041a231-b9ec-46d4-a12f-b83925dd837d\",\"type\":\"ToolEvents\"},{\"attributes\":{\"data_source\":{\"id\":\"5b41159e-fcf1-482a-9bbd-5eed58605f19\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"94e1a07f-65dc-4ed2-9bba-795b3715cc65\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"899b315b-a157-40ec-a693-d6783b0acc08\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"callback\":null},\"id\":\"fb4c1f3f-7973-429e-b20c-84fbc84f54f4\",\"type\":\"DataRange1d\"},{\"attributes\":{\"formatter\":{\"id\":\"f6591b61-cf37-42e8-bb08-9f285bb254cf\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"}},\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"a15f1388-a984-44fb-9983-8567ee85cba7\",\"type\":\"ResizeTool\"},{\"attributes\":{\"data_source\":{\"id\":\"e2c178fc-307d-4ec5-9ee9-246fff42cdc7\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"6987def8-38b8-4c6d-9d3a-9577a15ea9d8\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"aa9d0b2b-0d1a-428f-84bd-4b4c1f994172\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"legends\":[[\"alpha100\",[{\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"}]],[\"alpha50\",[{\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"}]],[\"long100\",[{\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"}]]],\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"aec8a12a-abe3-4f98-bc1b-21aa6b489d42\",\"type\":\"Legend\"},{\"attributes\":{\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"}},\"id\":\"ecf890ca-8c6a-4746-ac10-1e65b80b8705\",\"type\":\"Grid\"},{\"attributes\":{\"callback\":null},\"id\":\"5e14208a-9fcd-41fd-b35b-05ee0b203731\",\"type\":\"DataRange1d\"},{\"attributes\":{\"dimension\":1,\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"}},\"id\":\"a03d1ed3-1335-4b37-830c-0226be7c76fc\",\"type\":\"Grid\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"899b315b-a157-40ec-a693-d6783b0acc08\",\"type\":\"Line\"},{\"attributes\":{\"formatter\":{\"id\":\"3a46ac48-e324-4a68-a74c-ac6505b04780\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"}},\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"},{\"attributes\":{\"line_color\":{\"value\":\"blue\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"6987def8-38b8-4c6d-9d3a-9577a15ea9d8\",\"type\":\"Line\"},{\"attributes\":{\"below\":[{\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":900,\"renderers\":[{\"id\":\"6132fbb6-d00c-4125-8f24-faf5a41e1c6d\",\"type\":\"LinearAxis\"},{\"id\":\"ecf890ca-8c6a-4746-ac10-1e65b80b8705\",\"type\":\"Grid\"},{\"id\":\"d2b48994-5cfd-41f8-8b74-4f13defc7281\",\"type\":\"LinearAxis\"},{\"id\":\"a03d1ed3-1335-4b37-830c-0226be7c76fc\",\"type\":\"Grid\"},{\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},{\"id\":\"aec8a12a-abe3-4f98-bc1b-21aa6b489d42\",\"type\":\"Legend\"},{\"id\":\"18f8d668-25c6-4a63-96d9-b4bfc7d69e53\",\"type\":\"GlyphRenderer\"},{\"id\":\"438d3601-e57c-4f13-8694-e53520838a84\",\"type\":\"GlyphRenderer\"},{\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"}],\"title\":\"Alpha of long/short by DNN\",\"tool_events\":{\"id\":\"255f1ed8-1817-4bea-8d9a-d248167ab802\",\"type\":\"ToolEvents\"},\"tools\":[{\"id\":\"a3283ae5-d83d-4326-a623-71b60610ed05\",\"type\":\"PanTool\"},{\"id\":\"41d90305-9961-437e-b81a-d2ffdca10e58\",\"type\":\"WheelZoomTool\"},{\"id\":\"f8c8d8fd-bb8e-46dd-9604-d32bd58060b1\",\"type\":\"BoxZoomTool\"},{\"id\":\"60b9a717-0fc3-441a-a1a4-bbef97478361\",\"type\":\"PreviewSaveTool\"},{\"id\":\"a15f1388-a984-44fb-9983-8567ee85cba7\",\"type\":\"ResizeTool\"},{\"id\":\"d1f5245c-06f3-49ff-8614-da0e568159e2\",\"type\":\"ResetTool\"},{\"id\":\"e6750762-3873-472b-b166-0404d8b4ebed\",\"type\":\"HelpTool\"}],\"x_range\":{\"id\":\"b0f127d0-9f5d-4f0e-a31d-29bc937e119e\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"5e14208a-9fcd-41fd-b35b-05ee0b203731\",\"type\":\"DataRange1d\"}},\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"d1f5245c-06f3-49ff-8614-da0e568159e2\",\"type\":\"ResetTool\"},{\"attributes\":{\"formatter\":{\"id\":\"1dadb927-c5cd-4876-a9df-7bd3fd9ece4a\",\"type\":\"BasicTickFormatter\"},\"major_label_orientation\":0.7853981633974483,\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"}},\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.05306181666874978,0.09467546949146434,0.002342753826899399,-0.027238409383948593,0.0012035340209464174,0.022646916596573585,0.054853315481011966,0.09097810856396119,-0.005458470357716197,0.05484141500412662,0.023051292700560694,-0.01839458785267603,0.10672028454522842,0.05646901047303457,0.07110074762513482,-0.03119974882545369,0.01572973511170962,-0.0018220477558412024,0.010055728330248155,0.10548258419041594,0.021591689478919797,0.09436536634795344,0.0034181401167152348,0.004863326554968517,0.10522123247658557,0.0737338451094778,0.05581213491807141,0.09155708684031583,0.008467144074454543,-0.05715732985631199,-0.01918820728616158,0.06213403837899944,-0.06396194351349761,0.16216465778932382,0.029862071136332206,0.025094044650723808,-0.08702444156324118,0.10723368138692901,0.08052227613050819,0.07682542481303621,0.014593485024085417,0.020979572151452103,0.09266765171061843,0.1010526359659648,0.0324941459013986,0.017356554780281013,-0.0026040361808371965,-0.21113522281725292,0.13601718379640707,0.008915526018755005,0.019209666597051978,0.14181152357811916,0.18998156932912816,0.2059980021358327,0.04339780533954085,0.1713394702584166,0.15234026358054809,0.017356554780281013,0.0026029607594948018,-0.208092155878291,0.14930861932745706,0.008915526018754977,0.017419963810890032,0.14306230451883717,0.2027739926513481,0.19855131270120271,0.042086235874140815,0.1435677607854506,0.1137977909479427]}},\"id\":\"d29c4860-f00b-47e0-a3e5-e3bad211b501\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"60b9a717-0fc3-441a-a1a4-bbef97478361\",\"type\":\"PreviewSaveTool\"},{\"attributes\":{\"legends\":[[\"alpha100\",[{\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"}]],[\"alpha50\",[{\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"}]]],\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"8fead27e-057b-45d0-885f-476f632641de\",\"type\":\"Legend\"},{\"attributes\":{\"formatter\":{\"id\":\"acf8624b-4277-4c06-9211-2e73b2a88d82\",\"type\":\"BasicTickFormatter\"},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"}},\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"},{\"attributes\":{},\"id\":\"255f1ed8-1817-4bea-8d9a-d248167ab802\",\"type\":\"ToolEvents\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[1.0,1.0582022270232716,1.1344555328377217,1.150385796450307,1.071719787095604,0.9757201605083474,1.1069564989079355,1.02698517305031,1.0440199659310279,1.006871896925854,1.0471958948239315,0.9512519105856722,0.8368870595118069,0.9215792364813269,1.036892786418623,1.0002840540313387,1.0112814310397094,1.0015593209424007,0.9498856666192875,0.9527269024909604,0.9790734086252341,1.0186773269063778,0.9975860770709333,0.8958386230778594,1.05362997241951,1.110842187040253,1.1972694702829774,1.159259591296055,1.2289539465174484,1.1972727110137549,1.1502955400484274,1.2056119776734457,1.3203892926655862,1.4012374527621458,1.3534272802040372,1.4601277299491764,1.4172226310456568,1.483891512087933,1.4806219771511855,1.5748004368772337,1.5267096772980089,1.616616021706449,1.7394534800427746,1.9182102466036783,2.0999029547897026,2.3856211129727063,2.511054674716383,2.627698380686602,2.4051807807471763,2.7122646448642347,2.9891486435453563,3.6814821799235533,4.317638253132642,5.990059973469138,5.7445604189555,4.775948731889229,4.576977476957752,4.9377564197013015]}},\"id\":\"18d15973-03e4-4425-94f8-13d3b3bf9f20\",\"type\":\"ColumnDataSource\"},{\"attributes\":{},\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"0c975e1f-8fbb-4bc0-8657-86ec23223d11\",\"type\":\"BasicTicker\"},{\"attributes\":{\"dimension\":1,\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"5794a238-bd3c-44b3-8aee-be5a4a60d079\",\"type\":\"BasicTicker\"}},\"id\":\"c3da3857-351f-4acc-9a02-875c59d054df\",\"type\":\"Grid\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"997ff215-9da4-4a28-b3f2-253e58b763f6\",\"type\":\"PanTool\"},{\"attributes\":{\"callback\":null},\"id\":\"e762706b-d4e5-4771-9144-97a164ceba43\",\"type\":\"DataRange1d\"},{\"attributes\":{\"below\":[{\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"}],\"left\":[{\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"}],\"plot_height\":400,\"plot_width\":900,\"renderers\":[{\"id\":\"fa93144d-37cf-4513-8970-42e7ac307560\",\"type\":\"LinearAxis\"},{\"id\":\"b354cec4-a545-4d27-9ff2-33ade55fe4cb\",\"type\":\"Grid\"},{\"id\":\"78c6dc04-5a28-49e0-b5c1-f705438788c2\",\"type\":\"LinearAxis\"},{\"id\":\"c3da3857-351f-4acc-9a02-875c59d054df\",\"type\":\"Grid\"},{\"id\":\"967ffcee-8f34-4405-bf41-a6d6eb3dd7ac\",\"type\":\"BoxAnnotation\"},{\"id\":\"8fead27e-057b-45d0-885f-476f632641de\",\"type\":\"Legend\"},{\"id\":\"e610a5cb-6745-4352-91c7-7db5e88382fe\",\"type\":\"GlyphRenderer\"},{\"id\":\"6f919875-8972-40cd-9f8f-0e2f27254212\",\"type\":\"GlyphRenderer\"}],\"title\":\"Alpha NAV of long/short by DNN\",\"tool_events\":{\"id\":\"3041a231-b9ec-46d4-a12f-b83925dd837d\",\"type\":\"ToolEvents\"},\"tools\":[{\"id\":\"997ff215-9da4-4a28-b3f2-253e58b763f6\",\"type\":\"PanTool\"},{\"id\":\"af85b8d2-0128-46c6-8a52-85a470db5e7f\",\"type\":\"WheelZoomTool\"},{\"id\":\"0c265bf3-9f01-46dc-b0de-0d98dc26e810\",\"type\":\"BoxZoomTool\"},{\"id\":\"7b8b1d0f-40eb-4905-963c-f30be4e2a811\",\"type\":\"PreviewSaveTool\"},{\"id\":\"3a2b45c2-5c1a-47af-b791-f1957865d6ba\",\"type\":\"ResizeTool\"},{\"id\":\"ca1ef4e8-9f5f-4daa-842f-1e60327b2a8b\",\"type\":\"ResetTool\"},{\"id\":\"55fbcd8d-4105-48e2-ab7c-fe0e7ae408d8\",\"type\":\"HelpTool\"}],\"x_range\":{\"id\":\"e762706b-d4e5-4771-9144-97a164ceba43\",\"type\":\"DataRange1d\"},\"y_range\":{\"id\":\"fb4c1f3f-7973-429e-b20c-84fbc84f54f4\",\"type\":\"DataRange1d\"}},\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},{\"attributes\":{\"callback\":null},\"id\":\"b0f127d0-9f5d-4f0e-a31d-29bc937e119e\",\"type\":\"DataRange1d\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"ca1ef4e8-9f5f-4daa-842f-1e60327b2a8b\",\"type\":\"ResetTool\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"aa9d0b2b-0d1a-428f-84bd-4b4c1f994172\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"af85b8d2-0128-46c6-8a52-85a470db5e7f\",\"type\":\"WheelZoomTool\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"a3283ae5-d83d-4326-a623-71b60610ed05\",\"type\":\"PanTool\"},{\"attributes\":{\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"3a2b45c2-5c1a-47af-b791-f1957865d6ba\",\"type\":\"ResizeTool\"},{\"attributes\":{\"line_color\":{\"value\":\"red\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"e30bbf9c-1689-4540-8a6a-670e075538c5\",\"type\":\"Line\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"551c4af6-aaa9-403d-8ffd-7ac314757355\",\"type\":\"Line\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"41d90305-9961-437e-b81a-d2ffdca10e58\",\"type\":\"WheelZoomTool\"},{\"attributes\":{},\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"},{\"attributes\":{\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"e6750762-3873-472b-b166-0404d8b4ebed\",\"type\":\"HelpTool\"},{\"attributes\":{\"grid_line_alpha\":{\"value\":0.3},\"plot\":{\"id\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"subtype\":\"Figure\",\"type\":\"Plot\"},\"ticker\":{\"id\":\"d52258c9-deaf-4636-a1b8-84e2ae23ec1f\",\"type\":\"BasicTicker\"}},\"id\":\"b354cec4-a545-4d27-9ff2-33ade55fe4cb\",\"type\":\"Grid\"},{\"attributes\":{\"overlay\":{\"id\":\"3d2b0b82-343b-4291-9d79-c2030f27c001\",\"type\":\"BoxAnnotation\"},\"plot\":{\"id\":\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"subtype\":\"Figure\",\"type\":\"Plot\"}},\"id\":\"f8c8d8fd-bb8e-46dd-9604-d32bd58060b1\",\"type\":\"BoxZoomTool\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.0582022270232716,0.07205929440249909,0.014042210691799997,-0.06838228496686867,-0.08957530479811203,0.13450202600222397,-0.07224432571336002,0.01658718482772432,-0.0355817610940479,0.0400487867634336,-0.09161990102567258,-0.1202256203653274,0.10119905189945787,0.12512602863924496,-0.0353061887080236,0.010994254046187462,-0.009613654319068387,-0.05159320395969333,0.0029911345875815003,0.027653786269065294,0.0404504074283393,-0.02070454429323218,-0.10199365882473019,0.17613814059447697,0.054300101666017904,0.07780338580136467,-0.031747137908676976,0.06011971412155842,-0.025779025807655703,-0.0392368175881592,0.04808889167968907,0.09520253374857328,0.06123054810096508,-0.03411996479530591,0.0788372240650072,-0.029384483304767495,0.047041925228844504,-0.0022033517343509014,0.0636073631078028,-0.030537684936503294,0.0588889595352258,0.07598431333537209,0.10276605187309054,0.09471991326692346,0.13606255352482102,0.05257899549160789,0.04645207734610302,-0.08468156070533599,0.12767600114518704,0.10208590787975319,0.231615626701333,0.17279890058364977,0.38734642003022807,-0.04098449023899438,-0.168613717399527,-0.04166109522971571,0.07882471446710158,0.05264118891312189,0.043032540230428004,-0.08468156070533599,0.127676001145187,0.10226521784376921,0.234717005841113,0.17465341903347167,0.38322384531060805,-0.04098449023899438,-0.169437639606537,-0.05116500495857931,0.07192357666731697]}},\"id\":\"503bd608-ec31-4099-b031-0a0a518edb13\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"data_source\":{\"id\":\"503bd608-ec31-4099-b031-0a0a518edb13\",\"type\":\"ColumnDataSource\"},\"glyph\":{\"id\":\"e30bbf9c-1689-4540-8a6a-670e075538c5\",\"type\":\"Line\"},\"hover_glyph\":null,\"nonselection_glyph\":{\"id\":\"fa57b1ce-9e33-4f3f-8087-7157c9b342b4\",\"type\":\"Line\"},\"selection_glyph\":null},\"id\":\"2c20c4f9-1349-434f-af92-8907644e9b54\",\"type\":\"GlyphRenderer\"},{\"attributes\":{\"line_alpha\":{\"value\":0.1},\"line_color\":{\"value\":\"#1f77b4\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"fa57b1ce-9e33-4f3f-8087-7157c9b342b4\",\"type\":\"Line\"},{\"attributes\":{},\"id\":\"d3291ea5-6f43-4102-8a3b-5dbb51b98502\",\"type\":\"BasicTicker\"},{\"attributes\":{},\"id\":\"f6591b61-cf37-42e8-bb08-9f285bb254cf\",\"type\":\"BasicTickFormatter\"},{\"attributes\":{\"line_color\":{\"value\":\"orange\"},\"x\":{\"field\":\"x\"},\"y\":{\"field\":\"y\"}},\"id\":\"25bc3af7-7ab8-477f-a910-33a602582e23\",\"type\":\"Line\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[1.0,1.0347770995995975,1.1264991119627437,1.1365537263648688,1.1161135207318722,1.1286342211550007,1.1643193542458394,1.2208901454809922,1.324212160784313,1.3419730810304917,1.4199749818371659,1.4440902508260351,1.4270014242007678,1.5663250887981115,1.6234917204083708,1.7263219222990236,1.7154028821090814,1.7632604886134462,1.754071361513525,1.8069708565021123,2.0260438824626634,2.0678283900725543,2.222735043450716,2.2014478851753108,2.195976935079233,2.3905463047845394,2.4881999059354665,2.561578219185802,2.6617201851889636,2.6766017332378444,2.5153495760723095,2.4409658761822266,2.5339680915482594,2.4308389737530565,2.787784185124254,2.8415122017554393,2.878041532598836,2.6116450972442684,2.8615111376620606,3.0114341673667915,3.2210185038205337,3.293109464504718,3.307706830809645,3.622316400290315,3.9127883247943567,3.9800293688607287,4.113053011152808,4.047760166775552,3.341247520222146,3.817285536732752,3.905217528332271,3.9241007135918125,4.320595045855887,5.177061176015417,5.9911646996844325,6.188760337017731,7.175739137270957,7.886490793463007]}},\"id\":\"e2c178fc-307d-4ec5-9ee9-246fff42cdc7\",\"type\":\"ColumnDataSource\"},{\"attributes\":{\"callback\":null,\"column_names\":[\"y\",\"x\"],\"data\":{\"x\":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],\"y\":[0.03477709959959756,0.08863939141930906,0.008925541347836994,-0.01798437254556559,0.011218124492317127,0.03161797898908299,0.04858700581490835,0.08462842925365341,0.013412443090433102,0.05812478797769691,0.016982883006621083,-0.011833627860511023,0.09763386513463067,0.03649729677389328,0.06333891365013376,-0.006325031298566042,0.027898756031891618,-0.005211440487246019,0.030158120216353175,0.12123771956379377,0.020623693283040607,0.07491272202367169,-0.00957701114135405,-0.0024851599408367286,0.08860264723057582,0.040849909895273165,0.029490521672031034,0.03909385442658543,0.005590951344806576,-0.060245106757242706,-0.029571913422162234,0.03810057988663577,-0.04069866473030094,0.14684033587798603,0.019272659956204863,0.01285559527804581,-0.09256170640248376,0.09567381137714455,0.05239295690011635,0.06959618733322773,0.022381417740592102,0.004432699994417755,0.09511410338734924,0.08018955066453085,0.017184942931945002,0.0334227790711397,-0.01587454482113674,-0.17454409783280575,0.14247313724274957,0.02303521461870539,0.004835373477288879,0.10104081449559814,0.19822874420527156,0.15725205787419333,0.03298117264973635,0.1594792408343342,0.09904926065391494,0.032555113764676694,-0.01948312099503849,-0.17960134489387275,0.14145506110096653,0.024543352149800385,0.009937252729128904,0.10416987628254006,0.19463884628884742,0.15699460829291423,0.03130066652950236,0.1003582938880839,0.11314953202238234]}},\"id\":\"5b41159e-fcf1-482a-9bbd-5eed58605f19\",\"type\":\"ColumnDataSource\"}],\"root_ids\":[\"98a64b3b-2ffd-43d1-825e-c564f56147f8\",\"eb733da0-94d2-4f2e-8228-db822a2757a0\"]},\"title\":\"Bokeh Application\",\"version\":\"0.11.1\"}};\n",
       "            var render_items = [{\"docid\":\"9faad303-e6fe-4b19-9978-1f8d97d9d8f3\",\"elementid\":\"f358ccfc-413e-4b2e-b750-d20e802dabef\",\"modelid\":\"eb733da0-94d2-4f2e-8228-db822a2757a0\",\"notebook_comms_target\":\"5daa0799-a6ee-4ec0-b708-127f1cda2f27\"}];\n",
       "            \n",
       "            Bokeh.embed.embed_items(docs_json, render_items);\n",
       "        });\n",
       "      },\n",
       "      function(Bokeh) {\n",
       "      }\n",
       "    ];\n",
       "  \n",
       "    function run_inline_js() {\n",
       "      for (var i = 0; i < inline_js.length; i++) {\n",
       "        inline_js[i](window.Bokeh);\n",
       "      }\n",
       "    }\n",
       "  \n",
       "    if (window._bokeh_is_loading === 0) {\n",
       "      console.log(\"Bokeh: BokehJS loaded, going straight to plotting\");\n",
       "      run_inline_js();\n",
       "    } else {\n",
       "      load_libs(js_urls, function() {\n",
       "        console.log(\"Bokeh: BokehJS plotting callback run at\", now());\n",
       "        run_inline_js();\n",
       "      });\n",
       "    }\n",
       "  }(this));\n",
       "</script>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<p><code>&lt;Bokeh Notebook handle for <strong>In[6]</strong>&gt;</code></p>"
      ],
      "text/plain": [
       "<bokeh.io._CommsHandle at 0x7fc1d364ca20>"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "show(p)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  },
  "widgets": {
   "state": {
    "2061536DF34A484B9DDCC76A21DA70AF": {
     "views": []
    }
   },
   "version": "1.1.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
